class MyCircularQueue:
    class Node:
        def __init__(self, val, next_=None):
            self.val = val
            self.next = next_

    def __init__(self, k: int):
        """
        Initialize your data structure here. Set the size of the queue to be k.
        """
        self.tail = None
        self.size = 0
        self.length = k

    def enQueue(self, value: int) -> bool:
        """
        Insert an element into the circular queue. Return true if the operation is successful.
        """
        if not self.isEmpty():
            if self.size >= self.length:
                return False
            newest = self.Node(value, self.tail.next)
            self.tail.next = newest
            self.tail = newest
        else:
            self.tail = self.Node(value)
            self.tail.next = self.tail

        self.size += 1
        return True

    def deQueue(self) -> bool:
        """
        Delete an element from the circular queue. Return true if the operation is successful.
        """
        if self.isEmpty():
            return False
        first = self.tail.next
        if self.size == 1:
            self.tail = None
        else:
            self.tail.next = first.next

        self.size -= 1
        return True

    def Front(self) -> int:
        """
        Get the front item from the queue.
        """
        if self.tail:
            return self.tail.next.val

        return -1

    def Rear(self) -> int:
        """
        Get the last item from the queue.
        """
        if self.tail:
            return self.tail.val

        return -1

    def isEmpty(self) -> bool:
        """
        Checks whether the circular queue is empty or not.
        """
        return self.size == 0

    def isFull(self) -> bool:
        """
        Checks whether the circular queue is full or not.
        """
        return self.size == self.length


# Your MyCircularQueue object will be instantiated and called as such:
# obj = MyCircularQueue(k)
# param_1 = obj.enQueue(value)
# param_2 = obj.deQueue()
# param_3 = obj.Front()
# param_4 = obj.Rear()
# param_5 = obj.isEmpty()
# param_6 = obj.isFull()
